﻿namespace Legend.Core.Tests
{
    using System;
    using NUnit.Framework;

    [TestFixture]
    public class ShortGuidConverterTests
    {
        [Test]
        public void Should_be_able_to_parse_guid_string()
        {
            // Arrange
            var shortGuid = "3L9QsL8_OkSFIFut_-y_9w";
            var expectedGuid = new Guid("b050bfdc-3fbf-443a-8520-5badffecbff7");

            var converter = new ShortGuidConverter();

            // Act
            var result = converter.ConvertFrom(shortGuid);

            // Assert
            Assert.That(result, Is.EqualTo(expectedGuid));
        }

        [Test]
        public void Should_convert_guid_to_correct_string()
        {
            // Arrange
            var guid = new Guid("b050bfdc-3fbf-443a-8520-5badffecbff7");
            var converter = new ShortGuidConverter();

            // Act
            var result = converter.ConvertToString(guid);

            // Assert
            Assert.That(result, Is.EqualTo("3L9QsL8_OkSFIFut_-y_9w"));
        }
    }
}
